<%--
  Created by IntelliJ IDEA.
  User: MECHREVO
  Date: 2021/4/6
  Time: 10:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page isELIgnored="false" contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>


<link href="${pageContext.request.contextPath}/ui/layui/css/layui.css" rel="stylesheet"/>
<script src="${pageContext.request.contextPath}/ui/layui/layui.js"></script>

<style>

    .btn-group{
        width: 467px;
        height: 100px;
        margin-left: 37px;
        margin-top: 35px;
    }

    .lmhdiv{
        width: 467px;
        height: 30px;
        margin-left: 37px;
        margin-top: 35px;
    }

</style>
<body>




<div class="box">
    <ul class="layui-nav">
        <li class="layui-nav-item"><a href="">首页</a></li>

        <li class="layui-nav-item"><a href="${pageContext.request.contextPath}/demandhall">需求大厅</a></li>
        <li class="layui-nav-item" style="margin-left: 1532px;">
            <a href="javascript:;">${userinfo.userName}</a>
            <dl class="layui-nav-child">
                <dd><a href="${pageContext.request.contextPath}/updatedanInfo">基本信息</a></dd>
                <dd><a href="${pageContext.request.contextPath}/anquan">安全管理</a></dd>
            </dl>
        </li>
        <li class="layui-nav-item"><a href="${pageContext.request.contextPath}/WEB-INF/jsp/login.jsp">退出</a></li>
    </ul>

    <form class="layui-form" action="${pageContext.request.contextPath}/demandadd" method="post">
        <div class="lmhdiv">
            <span>项目类型</span>
        </div>
        <%--<div class="btn-group" id="projecttype">



        </div>--%>
        <div class="layui-form-item">

            <input type="hidden" value="${pageContext.request.contextPath}" id="projecttype">
            <div class="layui-input-inline">
                <select name="projectTypeId"  onclick="provines()" id="projecttypeid"  lay-filter="provinceid" >



                </select>
            </div>

        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">项目名称</label>
            <div class="layui-input-block">
                <input type="text" name="demandProjectName" lay-verify="title" autocomplete="off" placeholder="请输入名称" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">需求描述</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" class="layui-textarea" name="demandProjectDescribe"></textarea>
            </div>
        </div>


        <div class="layui-form-item" pane="">
            <label class="layui-form-label">技能要求</label>
            <div class="layui-input-block" id="technical">
                <input type="checkbox" name="technicalName" lay-skin="primary" value="java" title="java" >
                <input type="checkbox" name="technicalName" lay-skin="primary" value="html5" title="html5" >
                <input type="checkbox" name="technicalName" lay-skin="primary" value="spring" title="spring" >
                <input type="checkbox" name="technicalName" lay-skin="primary" value="mybatis" title="mybatis" >
                <input type="checkbox" name="technicalName" lay-skin="primary" value="c++" title="c++" >

            </div>
        </div>


        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">工期与预算</label>
                <div class="layui-input-inline">
                    <input type="text" name="duration" lay-verify="required|number" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"></label>
                <div class="layui-input-block">
                    <input type="radio" name="durationUnit" value="d" title="天" >
                    <input type="radio" name="durationUnit" value="m" title="月">

                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">设置预算金额（元）</label>
                <div class="layui-input-inline">
                    <input type="text" name="budgetAmount" id="date"   autocomplete="off" class="layui-input">
                </div>
            </div>

        </div>

        <div class="layui-form-item">

            <div class="layui-inline">
                <label class="layui-form-label">联系人姓名</label>
                <div class="layui-input-inline">
                    <input type="text" name="linkman"  autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">联系电话</label>
                <div class="layui-input-inline">
                    <input type="tel" name="telephone" lay-verify="required|phone" autocomplete="off" class="layui-input">
                </div>
            </div>

        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">驻场要求</label>
            <div class="layui-input-block">
                <input type="radio" name="onesite" value="1" title="无需驻场" >
                <input type="radio" name="onesite" value="2" title="偶尔到场交流">
                <input type="radio" name="onesite" value="3" title="定期驻场" >
                <input type="radio" name="onesite" value="4" title="全程驻场">

            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">地域要求</label>
            <input type="hidden" value="${pageContext.request.contextPath}" id="contextPath">
            <div class="layui-input-inline">
                <select name="provinceid"  onclick="provines()" id="provinceid"  lay-filter="provinceid" >



                </select>
            </div>
            <div class="layui-input-inline">
                <select name="cityid" id="cities" onchange="cChange()" >



                </select>
            </div>


        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" name="tj" lay-submit="" lay-filter="demo1" value="1">草稿箱</button>
                <button type="submit" class="layui-btn" name="tj" lay-submit="" xlay-filter="demo1" value="0">立即提交</button>
            </div>
       </div>
    </form>
</div>








<script src="${pageContext.request.contextPath}/js/jquery-3.4.1.js"></script>


<script type="text/javascript">




    $(document).ready(function(){


        layui.use('form',function (){
            var form=layui.form;
            $.ajax({

                type:"post",
                url:"${pageContext.request.contextPath}/projecttypequan",
                dataType:"json",
                async:true,
                contentType:"application/json;charset=utf-8",
                success:function(data){
                    var element='';
                    for(var i=0;i<data.length;i++){
                        /*element+="<input type='checkbox' name='like1[read]'  value='" + data[i].projectTypeId + "'>"+data[i].prohectTypeName;*/
                        element+=" <option value='" + data[i].projectTypeId + "'>" + data[i].prohectTypeName + "</option>";

                        console.log(element);
                    }

                    $("#projecttypeid").html(element);
                    form.render('select');
                },
                error:function(data,errrorMessage,e){
                    alert("服务器异常，请重试");
                }
            });

        });

    });




       /* $(document).ready(function(){


            layui.use('form',function (){
                var form=layui.form;
                $.ajax({

                    type:"post",
                    url:"${pageContext.request.contextPath}/technicalquan",
                    dataType:"json",
                    async:true,
                    contentType:"application/json;charset=utf-8",
                    success:function(data){
                        var element='';
                        for(var i=0;i<data.length;i++){
                            element+="<input type='checkbox' name='like1[read]' lay-skin='primary' title='"+阅读+"'/>";
                            console.log(element);
                        }

                        $("#technical").html(element);
                        form.render('select');
                    },
                    error:function(data,errrorMessage,e){
                        alert("服务器异常，请重试");
                    }
                });

            });

        });*/







    $(document).ready(function(){


        layui.use('form',function (){
            var form=layui.form;
            $.ajax({

                type:"post",
                url:"${pageContext.request.contextPath}/updatedanInfo1",
                dataType:"json",
                async:true,
                contentType:"application/json;charset=utf-8",
                success:function(data){
                    var element='';
                    for(var i=0;i<data.length;i++){
                        element+=" <option value='" + data[i].provinceid + "'>" + data[i].province + "</option>";
                    }

                    $("#provinceid").html(element);
                    /*$("#homeprovinceid").html(element);*/
                    form.render('select');
                },
                error:function(data,errrorMessage,e){
                    alert("服务器异常，请重试");
                }
            });

        })

    })






    layui.use('form',function (){
        var form=layui.form;

        form.on('select(provinceid)',function (provincedata){

            var url=$("#contextPath").val()+"/citiesquan";

            $.ajax({
                type:"post",
                url:url,
                data:JSON.stringify({
                    "provinceid":provincedata.value
                }),
                dataType:"json",
                async:true,
                contentType:"application/json;charset=utf-8",
                success:function(data){
                    var element='';
                    for(var i=0;i<data.length;i++){
                        element+=" <option value='" + data[i].cityid + "'>" + data[i].city + "</option>";
                    }

                    $("#cities").html(element);
                    /*$("#homecities").html(element);*/
                    form.render('select');
                },

            });
            console.log("success")
        })

    })


    </script>



  </body>

</html>
<%--
























--%>